<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<form action="/changeLanguage.do" method="post">
	<p align="right">
		<%
			if (session.getAttribute("userlang") == null) {
				session.setAttribute("userlang", "EN-English");
			}
			if (session.getAttribute("languagevalues") == null) {
		%>
		<jsp:useBean id="languagevalues"
			class="com.elbis.business.manager.ManageDefaultValuesList" scope="session" />
		<%
			}
		%>
		<select name="selectedlang">
			<c:forEach var="lang" items="${languagevalues.languageList}">
				<c:choose>
					<c:when test="${userlang == lang.code}">
						<option selected="selected" value="${lang.code}">${lang}</option>
					</c:when>
					<c:otherwise>
						<option value="${lang.code}">${lang}</option>
					</c:otherwise>
				</c:choose>
			</c:forEach>
		</select>
		<button type="submit">Change</button>
	</p>
</form>